package com.budwk.app.miniapp.common.enums;

import lombok.Getter;

/**
 * 安全隐患状态a17
 */
@Getter
public enum SqfwRallyEnum {

    TONGZHI(0, "通知"),
    BAOMING(1, "报名"),
    JSONBY(2, "JSON"),
    JSONBN(3, "JSON");

    private Integer code;

    private String name;

    SqfwRallyEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * @param code
     * @return
     */
    public static String getName(Integer code) {
        for (SqfwRallyEnum o : SqfwRallyEnum.values()) {
            if (o.getCode() == code) {
                return o.getName();
            }
        }
        return null;
    }

    public static Integer getCode(String name) {
        for (SqfwRallyEnum o : SqfwRallyEnum.values()) {
            if (o.getName() .equals(name) ) {
                return o.getCode();
            }
        }
        return null;
    }
}
